package com.slz3.business.module.wmsManagement.wmsWarningConfig.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.wmsManagement.wmsWarningConfig.domain.WmsWarningConfig;
import com.slz3.business.module.wmsManagement.wmsWarningConfig.domain.WmsWarningConfigCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class WmsWarningConfigResController extends WmsWarningConfigResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, WmsWarningConfig wmsWarningConfig) {
        if (WmsWarningConfigResUnsafeValid.add(req, wmsWarningConfig)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$WmsWarningConfigUpdateLock(req, wmsWarningConfig);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, WmsWarningConfigCondition wmsWarningConfigCondition) {
        if (WmsWarningConfigResUnsafeValid.delete(req, wmsWarningConfigCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$WmsWarningConfigUpdateLock(req, wmsWarningConfigCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, WmsWarningConfig wmsWarningConfig) {
        if (WmsWarningConfigResUnsafeValid.modify(req, wmsWarningConfig)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$WmsWarningConfigUpdateLock(req, wmsWarningConfig);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (WmsWarningConfigResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return wmsWarningConfigResAtomic.info_$WmsWarningConfigUpdateLock(req);
        if (WmsWarningConfigResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$WmsWarningConfigUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (WmsWarningConfigResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, WmsWarningConfigCondition wmsWarningConfigCondition) {
        //
        if (WmsWarningConfigResUnsafeValid.auditSubmit(req, wmsWarningConfigCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$WmsWarningConfigUpdateLock(req, wmsWarningConfigCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, WmsWarningConfigCondition wmsWarningConfigCondition) {
        if (WmsWarningConfigResUnsafeValid.audit(req, wmsWarningConfigCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$WmsWarningConfigUpdateLock(req, wmsWarningConfigCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, WmsWarningConfigCondition wmsWarningConfigCondition) {
        if (WmsWarningConfigResUnsafeValid.auditReject(req, wmsWarningConfigCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$WmsWarningConfigUpdateLock(req, wmsWarningConfigCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, WmsWarningConfigCondition wmsWarningConfigCondition) {
        if (WmsWarningConfigResUnsafeValid.usingEnable(req, wmsWarningConfigCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$WmsWarningConfigUpdateLock(req, wmsWarningConfigCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, WmsWarningConfigCondition wmsWarningConfigCondition) {
        if (WmsWarningConfigResUnsafeValid.usingDisable(req, wmsWarningConfigCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$WmsWarningConfigUpdateLock(req, wmsWarningConfigCondition);
        }
    }

}
